home *** CD-ROM | disk | FTP | other *** search
/ Macwelt 1 / Macwelt DVD 1.toast / Web-Publishing / HTML-Editoren / Alpha ƒ / Tcl / SystemCode / runAlphaTcl.tcl < prev    next >
Encoding:
Text File  |  2000-10-16  |  3.7 KB  |  133 lines

  1. # Rebuild the package and tcl indices, if necessary
  2. source [file join $HOME Tcl SystemCode rebuildAlphaTcl.tcl]
  3.  
  4. # pull in smarterSource and internationalMenus packages
  5. # if the user activated them
  6. lappend alpha::earlyPackages smarterSource internationalMenus
  7. alpha::package require Alpha
  8. foreach pkg [set alpha::earlyPackages] {
  9.     if {[lsearch -exact ${global::features} $pkg] != -1} {
  10.     alpha::package require $pkg
  11.     }
  12. }
  13. unset pkg
  14. # So we can handle times properly
  15. alpha::package require isoTime
  16.  
  17. set alpha::packagesAlwaysOn [list Alpha AlphaTcl isoTime filesets]
  18. if {${alpha::platform} != "alpha"} {
  19.     lappend alpha::packagesAlwaysOn supersearch
  20.     if {$tcl_platform(platform) == "windows"} {
  21.     lappend alpha::packagesAlwaysOn windowsMenuFixes
  22.     }
  23. }
  24. if {$tcl_platform(platform) == "macintosh"} {
  25.     lappend alpha::packagesAlwaysOn tclAE
  26. }
  27. foreach pkg [set alpha::packagesAlwaysOn] {
  28.     if {[lsearch -exact ${global::features} $pkg] == -1} {
  29.     lappend global::features $pkg
  30.     }
  31. }
  32. unset pkg
  33.  
  34. removeTemporaryFiles
  35. alpha::getDefinitions
  36. if {[info exists firsttime]} {
  37.     unset firsttime
  38.     lappend global::features internationalMenus filesetMenu
  39.     if {$tcl_platform(platform) == "macintosh"} {
  40.     lappend global::features internetConfigMenu eudoraMenu
  41.     }
  42.     if {!$skipPrefs} {
  43.     # For the moment we will force the user to go
  44.     # through this with every new release (see below)
  45.     # setupAssistant
  46.     }
  47. }
  48. if {!$skipPrefs} {
  49.     # Read both scalar and array definitions from preferences folder.
  50.     prefs::readAll
  51.     if {[key::optionPressed]} {
  52.     }
  53. }
  54. # define v. important keyboard variables
  55. keys::keyboardChanged
  56. message "Building basic menus…"
  57. menu::buildBasic
  58. message "Binding keys…"
  59. if {![info exists alpha::haveBasicKeys]} {
  60.     alpha::basicKeyBindings
  61. }
  62. alpha::keyBindings
  63. alpha::useElectricTemplates
  64. # Read in all packages, modes and menus.
  65. message "Reading in packages…"
  66. alpha::findAllPlugins
  67. if {!$skipPrefs} {
  68.     # read preferences file
  69.     if {[catch {prefs::tclRead} err]} {
  70.     append alpha::errorLog "\r" $err
  71.     unset err
  72.     }
  73. }
  74. # call anything that's attached to my keyboard.
  75. hook::callAll keyboard $keyboard
  76. message "Building complete menus…"
  77. # build all menus completely.
  78. alpha::buildMainMenus
  79. # insert menus
  80. global::insertAllMenus
  81. # Bind special keys
  82. bind::fromArray keys::specialBindings keys::specialProcs
  83.  
  84. # if we do anything else to a menu, it must now be rebuilt
  85. unset alpha::noMenusYet
  86.  
  87. # couple of random things
  88. alpha::makeColourList
  89.  
  90. # Add to chars considered part of words.
  91. addAlphaChars {_ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüÅØæøæß}
  92. # Call all startup hooks
  93. hook::callAll startupHook *
  94. # Alerts and readme's for the user:
  95.  
  96. if {!$skipPrefs} {
  97.     if {![info exists readReadme] \
  98.       || ([lindex $readReadme 0] != [alpha::package versions Alpha]) \
  99.       || ([lindex $readReadme 1] != [alpha::package versions AlphaTcl]) \
  100.     } {
  101.     # This may be removed later (see above)
  102.     if {![info exists readReadme]} {set readReadme ""}
  103.     setupAssistant $readReadme [list [alpha::package versions Alpha] \
  104.       [alpha::package versions AlphaTcl]]
  105.     prefs::add readReadme [list [alpha::package versions Alpha] \
  106.       [alpha::package versions AlphaTcl]]
  107.     if {[llength [set files [glob -nocomplain -path \
  108.       [file join $HOME Help Readme] *]]]} {
  109.         foreach f $files {
  110.         helpMenu [file tail $f]
  111.         }
  112.         unset f
  113.         unset files
  114.     } else {
  115.         alertnote "Alpha's readme file should be in\
  116.           '[file join $HOME Help]', but isn't.  You may wish\
  117.           to reinstall Alpha."
  118.     }
  119.     }
  120.     if {[info exists readReadme]} {
  121.     unset readReadme
  122.     }
  123.     
  124.     if {[info exists alpha::readAtStartup]} {
  125.     foreach f ${alpha::readAtStartup} {
  126.         catch {edit -r $f}
  127.     }
  128.     unset alpha::readAtStartup
  129.     lappend modifiedVars alpha::readAtStartup
  130.     }
  131. }
  132.  
  133.